#ifndef WRAP2VERTITERATORADAPTER_H_
#define WRAP2VERTITERATORADAPTER_H_

#include "graph_support/GraphSupport.h"

#include "graph_support/utils/PtrAccessOpSimulator.h"

namespace GRAPH_SUPPORT_NS
{
namespace impls
{

template< typename SuperIterT, typename VertexT >
class Wrap2VertIteratorAdapter : public SuperIterT
{
public:
	Wrap2VertIteratorAdapter( const SuperIterT & super )
		: SuperIterT( super )
	{
	}

	// TODO: why this code is here ?
	utils::PtrAccessOpSimulator< VertexT > operator -> ()
	{
		return utils::PtrAccessOpSimulator< VertexT >( ( const VertexT ) SuperIterT::operator * () );
	}

	const VertexT operator * ()
	{
		return ( const VertexT ) SuperIterT::operator * ();
	}
};

template < typename PrototypeT, typename ElementT >
class PrototypePtr2ElementIteratorAdapter
{
private:
	typedef PrototypePtr2ElementIteratorAdapter< PrototypeT, ElementT > MyT;
	typedef PrototypeT * PrototypePtr;
	typedef ElementT Element;
public:
	PrototypePtr2ElementIteratorAdapter( PrototypePtr ptr )
		: ptr( ptr )
	{
	}
	utils::PtrAccessOpSimulator< Element > operator -> ()
	{
		return utils::PtrAccessOpSimulator< Element >( ( Element ) * ptr );
	}
	Element operator * ()
	{
		return ( Element ) * ptr;
	}
	bool operator == ( const MyT & that ) const
	{
		return this->ptr == that.ptr;
	}
private:
	PrototypePtr ptr;
};

}
}

#endif /* WRAP2VERTITERATORADAPTER_H_ */
